<?php

/**
 * Radcodes - SocialEngine Module
 *
 * @category   Application_Extensions
 * @package  Radcodes
 * @copyright  Copyright (c) 2009-2010 Radcodes LLC (http://www.radcodes.com)
 * @license  http://www.radcodes.com/license/
 * @version  $Id$
 * @author   Vincent Van <vincent@radcodes.com>
 * @nulled	TrioxX
 */

class Radcodes_Lib_Validate_License extends Zend_Validate_Abstract {
	const INVALID = 'invalid';
	const INVALID_FORMAT = 'invalidFormat';
	/**
	 * @var array
	 */
	protected $_messageTemplates = array (self::INVALID => "'%value%' does not appear to be a valid license.", self::INVALID_FORMAT => "'%value%' is not in correct format of XXXX-XXXX-XXXX-XXXX." );
	
	/**
	 * License Type
	 * 
	 * @var string
	 */
	protected $_type;
	
	public function __construct($type) {
		$this->setType ( $type );
	}
	
	/**
	 * Return license type option
	 * 
	 * @return string
	 */
	public function getType() {
		return $this->_type;
	}
	
	/**
	 * Sets the type option
	 *
	 * @param  string $type
	 * @return Radcodes_Lib_Validate_License Provides a fluent interface
	 */
	public function setType($type) {
		$this->_type = $type;
		return $this;
	}
	
	/**
	 * Defined by Zend_Validate_Interface
	 *
	 * Returns true if and only if $value is a valid license
	 *
	 * @param  mixed $value
	 * @return boolean
	 */
	public function isValid($value) {
		return true;
	}
	
	protected function isValidFormat($value) {
		return true;
	}
}

